package com.errol.batchprocessor.employeeaddition.advisorimpl.demand.payload;

import com.renjia.entity.*;
import com.renjia.enums.EmployeeRegisterSourceEnum;
import com.renjia.service.module.employeeaddition.advisorimpl.EmployeeAdvisorTypeEnum;
import com.renjia.service.module.employeeaddition.advisorimpl.common.payload.AbstractEmployeeBatchPayload;
import lombok.Getter;
import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;

import java.util.List;

/**
 * 人员导入批次数据
 *
 * @author zhang xiao bin
 * @version v1.0
 * @date 2021/02/26
 * @since v5.0.6
 **/
@Getter
public class DemandEmployeeBatchPayload extends AbstractEmployeeBatchPayload<Object, BusDemandEmployeeTemp> {

    private final String demandId;
    private BusDemand busDemand;


    public DemandEmployeeBatchPayload(@NonNull String batchNo, @NonNull CoreEmployeeImportBatch importBatch, @NonNull List<BusDemandEmployeeTemp> singleEntityList,
                                      @NonNull EmployeeAdvisorTypeEnum employeeAdvisorType, @NonNull EmployeeRegisterSourceEnum employeeRegisterSource,
                                      @NonNull CoreCustomerChannelMerchant coreCustomerChannelMerchant, @NonNull CoreUser coreUser,
                                      @Nullable CoreChannelMerchant coreChannelMerchant, @Nullable CoreCustomer coreCustomer,
                                      @NonNull String demandId, @Nullable BusDemand busDemand) {
        super(batchNo, importBatch, null, singleEntityList, employeeAdvisorType, employeeRegisterSource,
                coreCustomerChannelMerchant, coreUser, coreChannelMerchant, coreCustomer);
        this.demandId = demandId;
        this.busDemand = busDemand;
    }

    public void setBusDemand(BusDemand busDemand) {
        if (this.busDemand == null) {
            this.busDemand = busDemand;
        }
    }
}
